#pragma once
#include <map>
#include <string>

#include "Define.h"

#pragma warning(disable : 4251)

class xQbFlagAdd_c;
class xQBFlagsAck_c;

class S_UAM_EXPORT CQBFlags {
 public:
  static const size_t kvsize = 1024;
  static const std::string CommonPageAddedFlag_Key;
  static const std::string CommonPageAddedFlag_Val;

 public:
  void Update(const xQbFlagAdd_c *pdata);
  void Update(const xQBFlagsAck_c *pdata);
  void Clear();
  bool GetValue(const char *pkey, std::string &pvalue);
  bool Initialized() { return m_bFlagInitialized; }

 protected:
  // key-value
  std::map<std::string, std::string> m_data;
  bool m_bFlagInitialized = false;

 public:
  static CQBFlags &instance() {
    static CQBFlags flags_;
    return flags_;
  }

 private:
  CQBFlags() = default;
  ~CQBFlags() = default;
};
